<?php

/**
 * Created by PhpStorm.
 * user: Evan
 * Date: 16/8/8
 * Time: 上午1:28
 */
class Index extends MY_Api_Controller
{
    /**
     * 首页
     * Index constructor.
     */
    public function homepage()
    {


        //版本检测,根据不同的版本调用不同的接口，记得及时清除不需要的版本
        $client  = isset($_SERVER['HTTP_CLIENT']) ? $_SERVER['HTTP_CLIENT'] : '';
        $version = isset($_SERVER['HTTP_APPVERSION']) ? $_SERVER['HTTP_APPVERSION'] : '';


        if(($client==1&&$version=='2.0.1')||($client==2&&$version=='1.3.6_test_debug')){
            $this->load->service('common/service_common_index_new');
            $data = $this->service_common_index_new->index();  #新版本调用新接口，edit_date:2017/10/20
        }else{
            $this->load->service('common/service_common_index');
            $data = $this->service_common_index->index();
        }

        $this->json_output($data['data'], $data['status']);
    }


    /**
     * 首页加载更多直播
     */
    public function direct_seeding_load_more()
    {
        $page  = (int)$this->input->get_post('page');
        $limit = (int)$this->input->get_post('limit');


        $this->load->service('common/service_common_index');
        $data = $this->service_common_index->direct_seeding_load_more($page, $limit);


        $this->json_output($data['data'], $data['status']);
    }
}